<include file="public@header"/>
</head>
<body>
<div class="wrap js-check-wrap">
    <ul class="nav nav-tabs">
        <li class="active"><a href="{:url('goods/index')}">商品列表</a></li>
        <li><a href="{:url('goods/add')}">添加商品</a></li>
    </ul>
    <form class="well form-inline margin-top-20" method="get" action="{:url('goods/index')}">
        <input type="text" class="form-control" name="key" style="width: 120px;"  placeholder="支持作者、标题查询">
        <input type="submit" class="btn btn-primary" value="搜索" />
        <a class="btn btn-danger" href="{:url('goods/index')}">清空</a>
    </form>
    <form method="post" class="js-ajax-form margin-top-20" action="{:url('goods/order')}">
        <div class="table-actions">
            <button type="submit" class="btn btn-primary btn-sm js-ajax-submit">排序</button>
        </div>

        <table class="table table-hover table-bordered table-list">
            <thead>
            <tr>
                <th width="16"><label>
                    <input type="checkbox" class="js-check-all" data-direction="x" data-checklist="js-check-x"></label>
                </th>
                <th width="50">排序</th>
                <th width="30">ID</th>
                <th>标题</th>
                <th>封面图片</th>
                <th>图集</th>
                <th>运费</th>
                <th>分类</th>
                <th>状态</th>
                <th>是否自营</th>
                <th>创建时间</th>

                <th >操作</th>
            </tr>
            </thead>
            <tbody>
            <foreach name="list" item="v">
                <tr>
                    <td><input type="checkbox" class="js-check" data-yid="js-check-y" data-xid="js-check-x" name="ides[]" value=""></td>
                    <td><input name='list_orders[{$v.id}]' style="width: 50px" value='{$v.list_order}'></td>
                    <td>{$v.id}</td>
                    <td>{$v.name}</td>
                    <td>
                        <img class="img-thumbnail js-image-previewer" src="/upload/{$v.image}" style="width: 80px;height: 50px">
                    </td>
                    <td>
                        <foreach name="$v['images']" item="vo">
                            <img src="/upload/{$vo}" class="img-thumbnail" style="width: 40px">
                        </foreach>
                    </td>



                    <td>{$v.freight}</td>
                    <td>{$v.sort_id}</td>
                    <td>
                        <switch name="$v.type">
                            <case value="0">无货</case>
                            <case value="1">正常</case>
                            <case value="2">下架</case>
                        </switch>
                    </td>
                    <td>
                        <eq name="$v.status" value="1">
                            <a href="{:url('Goods/changeStatus',['id' => $v['id']])}"  class="btn btn-success btn-sm js-ajax-form" data-msg="确定要改为隐藏吗？">是</a><else>
                            <a href="{:url('Goods/changeStatus',['id' => $v['id']])}"  class="btn btn-danger btn-sm js-ajax-form" data-msg="确定要改为隐藏吗？">否</a></else>
                        </eq>
                    </td>

                    <td>{$v.create_time|date="Y-m-d H:i:s"}</td>
                    <td>


                    <div class="btn-group" role="group">
                        <button type="button" class="btn btn-default btn-xs dropdown-toggle" data-toggle="dropdown" aria-expanded="false" aria-haspopup="true">
                            商品配置<span class="caret"></span>
                        </button>
                        <ul class="dropdown-menu">
                            <li>
                            <a class="btn btn-xs btn-primary" onclick="openIframeLayer('GoodsDetails?goods_id={$v.id}','配置商品属性',{area: ['60%','80%']})">
                                配置商品属性
                            </a>
                                    </li>
                                    <li>
                            <a class="btn btn-xs btn-primary" onclick="openIframeLayer('GoodsDetailvalue?goods_id={$v.id}','配置属性值',{area: ['60%','80%']})">
                                配置属性值
                            </a>
                                    </li>
                            <li>
                                <a class="btn btn-xs btn-primary" onclick="openIframeLayer('GoodsDetailattradd?goods_id={$v.id}','配置属性值',{area: ['60%','80%']})">
                                    属性
                                </a>
                            </li>
                                </ul>
                            </div>

                        <a class="btn btn-xs btn-primary" href="{:url('Goods/edit',['id' => $v['id']])}">编辑</a>
                        <a class="btn btn-xs btn-danger js-ajax-delete" href="{:url('Goods/del',['id' => $v['id']])}">
                            删除
                        </a>
                    </td>
                </tr>
            </foreach>>
            </tbody>
        </table>
        <div>
            <div class="pagination">{$list->render()}</div>
            <div>共有{$list->total()}条，每页显示{$list->listRows()}条，当前第{$list->currentPage()}页，共{$list->lastPage()}页。</div>
        </div>
    </form>
</div>
<script src="__STATIC__/js/admin.js?v={}"></script>
</body>
</html>